﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site_Usuario.Master" Inherits="System.Web.Mvc.ViewPage<Proyecto_e.Models.encuesta>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Ver
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<% using (Html.BeginForm("guardarResp", "Encuesta", FormMethod.Post)) ; %>
<form id="form1" method="post" runat="server" action="/Encuesta/guardarResp">

<h2 style="text-align: left"><span style="font-weight: normal">
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="/Encuesta/guardarResp" 
        style="font-size: small">&nbsp;Inicio</asp:HyperLink></span>
    <span style="font-size: small; font-weight: normal">&nbsp;&gt;&gt; Ver Encuesta</span></h2>
       <div>
           <br />
           <div>
               <strong>
               <span style="color: #000066">Estado actual de la encuesta:</span><span style="color: #000000">  <%= ViewData["estado"]%>
               </span>
               </strong>
           </div>
               <span style="color: #000000">
           <div>
               <strong>
               <br />
           </strong>
           </div>
           <div>
               <strong>
               <br />
           </strong>
               </span>
               <strong>
           <center style="color: #000066; font-size: large">Encuesta:<%= ViewData["titulo"] %></center>
           </strong>
           </div>
               <span style="color: #000000">
           <div>
           <strong>
           <br />
           <center><%= ViewData["descripcion"]%></center>
           </strong></span>
           </div>
            <div>
          <center> <span style="color: #663300"><strong>Preguntas</strong></span> </center>
           </div>
           <div>           
            <% var a=1; %> 
            <%int preg = 1; %>            
            <% foreach (Proyecto_e.Models.Pregunta p in (List<Proyecto_e.Models.Pregunta>)ViewData["preguntas"])
               { %>               
                   <%if (p.id_tipo_pregunta.CompareTo("Respuesta única") == 0)
                     { %>                    
                     <br />
                     <br />
                     <br />
                     <%=preg%>
                      <%=") "%>
                     <span style="color: #996633"><strong>¿ <% =p.enunciado%> ?</strong></span> 
                     <% int resp = 1;%>
                       <% foreach (string respuesta in (List<string>)p.respuestasList)
                          { %>
                         <br /> 
                         <br /> 
                         &nbsp;  &nbsp;
                         <%=resp%>
                         <%="  "%>
                         <input type="radio" name= '<% =String.Concat("opcion"," ",preg)%>'  value='<% =String.Concat(resp)%>'/>                          
                         <%=respuesta%>
                       <% resp++;
                          } %>                      
                   <% preg++;}%>
                   <%else if (p.id_tipo_pregunta.CompareTo("Respuesta desplegable") == 0)
                     { %>                    
                     <br />
                     <br />
                     <br />
                     <%int resp=1; %>
                     <%=preg%>
                      <%=") "%>
                     <strong>
                     <span style="color: #996633">¿</span><span style="color: #663300"> <% =p.enunciado%> </span> 
                     <span style="color: #996633">?</span></strong> 
                      <br /> 
                      <br />   
                      &nbsp;  &nbsp;                 
                     <select id='<% =String.Concat(preg," ")%>' name='<% =String.Concat(preg," ")%>'>
                       <% foreach (string respuesta in (List<string>)p.respuestasList)
                          { %> 
                         <option value='<% =String.Concat(resp)%>'>                          
                         <%=respuesta%>
                         </option>
                       <% resp++;
                          } %>  
                      </select>                    
                   <%preg++;} %>
                    <%else if (p.id_tipo_pregunta.CompareTo("Respuesta abierta") == 0)
                     { %>                    
                     <br />
                     <br /> 
                     <br />                    
                     <%=preg%>
                     <%=") "%>
                     <strong>
                     <span style="color: #996633">¿ <% =p.enunciado%> ?</span></strong> 
                      <br /> 
                      <br />   
                      &nbsp;  &nbsp; 
                     <textarea id='<% =String.Concat(preg," ","text")%>'  name='<% =String.Concat(preg," ","text")%>' rows="5" cols="150" ></textarea>                  
                   <%preg++;} %>
                    <%else if (p.id_tipo_pregunta.CompareTo("Múltiple respuesta") == 0)
                     { %>                    
                     <br />
                     <br />
                     <br />
                     <%int resp = 1; %>
                     <%=preg%>
                      <%=") "%>
                     <span style="color: #996633"><strong>¿ <% =p.enunciado%> ?</strong></span>                       
                       <span style="color: #996633">                       
                       <% foreach (string respuesta in (List<string>)p.respuestasList)
                          { %> 
                          </span> 
                          <br /> 
                          <br /> 
                          &nbsp;  &nbsp;
                          <%=resp%>
                          <%="  "%>
                         <input name='<% =String.Concat(preg," ",resp)%>' type="checkbox" value='<% =String.Concat(resp)%>'/>                     
                         <%=respuesta%>                        
                       <% resp++;
                          } %> 
                     <%preg++; } %>                            
            <%} %>
               <br />
               <br />
           </div>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input id="Button2" name="Button2" type="submit" value="Enviar" 
               style="font-weight: 700; text-align: center; width: 72px; height: 30px;" /><br />
       </div>
    </form>

</asp:Content>


